<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateOrderDetailsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('order_details', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->bigInteger('orderid')->index()->default(0)->comment('主订单ID');
            $table->bigInteger('goodsid')->index()->default(0)->comment('商品ID');
            $table->integer('amount')->default(0)->comment('商品数量');
            $table->decimal('goods_total_price')->default(10,2)->comment('商品单价');
			$table->decimal('goods_total_amount')->default(10,2)->comment('商品总金额');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('order_details');
    }
}
